package db.pojo;

import java.util.*;
import java.text.SimpleDateFormat;
import db.ext.EauserExt;
@SuppressWarnings("unchecked")
/**
 * eauser
 */
public class Eauser {
	/**
	 * USERID
	 */
	public String uSERID;
	/**
	 * USERNAME
	 */
	public String uSERNAME;
	/**
	 * ACCOUNT
	 */
	public String aCCOUNT;
	/**
	 * PASSWORD
	 */
	public String pASSWORD;
	/**
	 * SEX
	 */
	public String sEX;
	/**
	 * DEPTID
	 */
	public String dEPTID;
	/**
	 * LOCKED
	 */
	public String lOCKED;
	/**
	 * REMARK
	 */
	public String rEMARK;
	/**
	 * USERTYPE
	 */
	public String uSERTYPE;
	/**
	 * ENABLED
	 */
	public String eNABLED;
	SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	public static EauserExt DB = new EauserExt(); 
	
	public Eauser() {
		super();
	}
	
	public Eauser(String uSERID, String uSERNAME, String aCCOUNT, String pASSWORD, String sEX, String dEPTID, String lOCKED, String rEMARK, String uSERTYPE, String eNABLED) {
		super();
		this.uSERID = uSERID; 
		this.uSERNAME = uSERNAME; 
		this.aCCOUNT = aCCOUNT; 
		this.pASSWORD = pASSWORD; 
		this.sEX = sEX; 
		this.dEPTID = dEPTID; 
		this.lOCKED = lOCKED; 
		this.rEMARK = rEMARK; 
		this.uSERTYPE = uSERTYPE; 
		this.eNABLED = eNABLED; 
	}
	
	public String getUSERID() {
		return uSERID;
	}

	public void setUSERID(String uSERID) {
		this.uSERID = uSERID;
	} 
	
	public String getUSERNAME() {
		return uSERNAME;
	}

	public void setUSERNAME(String uSERNAME) {
		this.uSERNAME = uSERNAME;
	} 
	
	public String getACCOUNT() {
		return aCCOUNT;
	}

	public void setACCOUNT(String aCCOUNT) {
		this.aCCOUNT = aCCOUNT;
	} 
	
	public String getPASSWORD() {
		return pASSWORD;
	}

	public void setPASSWORD(String pASSWORD) {
		this.pASSWORD = pASSWORD;
	} 
	
	public String getSEX() {
		return sEX;
	}

	public void setSEX(String sEX) {
		this.sEX = sEX;
	} 
	
	public String getDEPTID() {
		return dEPTID;
	}

	public void setDEPTID(String dEPTID) {
		this.dEPTID = dEPTID;
	} 
	
	public String getLOCKED() {
		return lOCKED;
	}

	public void setLOCKED(String lOCKED) {
		this.lOCKED = lOCKED;
	} 
	
	public String getREMARK() {
		return rEMARK;
	}

	public void setREMARK(String rEMARK) {
		this.rEMARK = rEMARK;
	} 
	
	public String getUSERTYPE() {
		return uSERTYPE;
	}

	public void setUSERTYPE(String uSERTYPE) {
		this.uSERTYPE = uSERTYPE;
	} 
	
	public String getENABLED() {
		return eNABLED;
	}

	public void setENABLED(String eNABLED) {
		this.eNABLED = eNABLED;
	} 
	
	
	public Map eauserToMap() {
		Map map = new HashMap();
		try {
			map.put("uSERID",this.uSERID);
			map.put("uSERNAME",this.uSERNAME);
			map.put("aCCOUNT",this.aCCOUNT);
			map.put("pASSWORD",this.pASSWORD);
			map.put("sEX",this.sEX);
			map.put("dEPTID",this.dEPTID);
			map.put("lOCKED",this.lOCKED);
			map.put("rEMARK",this.rEMARK);
			map.put("uSERTYPE",this.uSERTYPE);
			map.put("eNABLED",this.eNABLED);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return map;
	}

	public Eauser mapToEauser(Map map){
		try {
			String uSERID =  map.get("uSERID").toString();
			String uSERNAME =  map.get("uSERNAME").toString();
			String aCCOUNT =  map.get("aCCOUNT").toString();
			String pASSWORD =  map.get("pASSWORD").toString();
			String sEX =  map.get("sEX").toString();
			String dEPTID =  map.get("dEPTID").toString();
			String lOCKED =  map.get("lOCKED").toString();
			String rEMARK =  map.get("rEMARK").toString();
			String uSERTYPE =  map.get("uSERTYPE").toString();
			String eNABLED =  map.get("eNABLED").toString();
			Eauser eauser = new Eauser(uSERID, uSERNAME, aCCOUNT, pASSWORD, sEX, dEPTID, lOCKED, rEMARK, uSERTYPE, eNABLED);
			return eauser;
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	} 
	
	public String toString(){
		return eauserToMap().toString();
	}
	
	//方便数据操作	
	public Eauser insert(){
		return DB.insert(this);
	}
	public Eauser update(){
		return DB.update(this);
	}
	
	public int delete(){
		return DB.delete(this);
	}
	
}
